package com.cyl.manager.oms.mapper;

import java.time.LocalDateTime;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyl.manager.oms.domain.dto.OrderItemPrepareDTO;
import com.cyl.manager.oms.domain.entity.OrderItem;
import com.cyl.manager.oms.domain.entity.OrderItemPrepare;
import com.cyl.manager.oms.domain.query.OrderItemDptjQuery;
import com.cyl.manager.oms.domain.vo.OrderItemDptjVO;

/**
 * 订单中所包含的商品Mapper接口
 * 
 * @author zcc
 */
public interface OrderItemMapper extends BaseMapper<OrderItem> {
    /**
     * 查询订单中所包含的商品列表
     *
     * @param orderItem 订单中所包含的商品
     * @return 订单中所包含的商品集合
     */
    List<OrderItem> selectByEntity(OrderItem orderItem);

	Integer getOrderProductSum(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime
    		,@Param("deptZbjId") Long deptZbjId ,@Param("deptTzId")Long deptTzId ,@Param("deptDpId")Long deptDpId);
	
	Integer getOrderProductSumByMid(@Param("memberId")Long memberId ,@Param("productId")Long productId);
	
	Integer getOrderProductCountByMid(@Param("memberId")Long memberId ,@Param("productId")Long productId);

	
	
	List<OrderItemPrepare> findOrderItemPrepares(@Param("lockId") Long lockId,@Param("deptZbjId") Long deptZbjId);
	
	

	
	
    int orderItemLock(@Param("deptDpId") Long deptDpId, @Param("lockId") Long lockId,@Param("prepareId") Long prepareId,  @Param("productId") Long productId,@Param("skuId") Long skuId);

	
    
	Integer getOrderProductDpSum(@Param("LockId")Long LockId ,@Param("prepareId")Long prepareId);

	/**
	 * 	店铺订单统计
	 * @param orderItem
	 * @return
	 */
    List<OrderItemDptjVO> findDpOrderTj(OrderItemDptjQuery orderItemDptjQuery);




}
